package org.nokatag.dbgrid;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;

import org.noka.gson.Gson;
import org.noka.select.SelectCustom;
import org.nokatag.elfunction.ELFunction;
import org.nokatag.password.AESPlus;
import org.nokatag.system.Concest;
import org.nokatag.system.Function;
import org.nokatag.tagjava.GridStyle;
import org.nokatag.tagjava.NHTMLBox;
import org.nokatag.tagjava.NokaBox;
import org.nokatag.tagjava.NokaTag;
/**
 * DBGrid标签主类
 * @author rebin
 */
public class NDBGrid extends NokaTag{
	private static final long serialVersionUID = -4678488692643850733L;
	
	private String 			width					= "700";		//表格宽
	private String 			height       			= "400";		//表格高
	private String 			id       				= "NK_DBGRID";	//表格ID
	private String 			title       			= null;			//标题
	private String 			sql       				= null;			//sql
	private String          number                  = "false";		//序号列
	private String          checkd                	= "false";		//是否要选择列
	private String 			onend					= null;			//在表格渲染结束时调用的方法
	private String 			pagesize				= null;			//页大小
	private String 			compositor				= null;			//排序列
	private String 			descorasc				= null;			//排序方式 AES 或  DES
	private String			subtabletype			= null;			//子表类型{cell:sql}
	private String			subtablestyleid			= null;			//子表标试
	private String			onloadsubtable          = null;			//在加载子表时调用
	private String			cellbody				= null;			//主表自定义单元格
	private String			subtable				= null;			//子表参数
	private String			subformatcell			= null;			//子表格式化列
	private String			formatcell				= null;			//格式化列
	private String			onrowdblclick			= null;			//双击行事件
	private String			onrowclick				= null;			//单击行事件
	private String			onloadjs				= null;			//在查询时调用的js方法
	private String			onload					= null;			//在查询时调用的后台方法
	private String			outexcelnopage			= null;			//导出EXCEL
	private String			outexcelall				= null;			//导出EXCEL
	private String			outcsvnopage			= null;			//导出csv
	private String			outcsvall				= null;			//导出csv
	private String			outpdfnopage			= null;			//导出PDF
	private String			outpdfall				= null;			//导出PDF
	private String			outuserfile				= null;			//自定义导出数据接口
	private Integer    		styleid   				= 1;			//样式id
	private String 			selectfiled 			= null;			//查询字符串 列名 条件 $[录入框名],列名 条件 $[录入框名]
	private String 			selectinput 			= "true";		//是否自动生成查询录入框
	private String 			selecttitle				= null;			//查询按钮名字
	private String			checkrecord				= null;			//选择记录
	private String			custombutton			= null;			//自定义按钮
	private String			custom					= null;			//自定义统计栏
	private String 			checkvalue				= null;			//选择框的值，默认为第一列
	private String 			checkname				= null;			//选择框名字
	private String			tableformname			= null;			//数据表名字
	private String			tableformid				= null;			//数据表id
	private String 			tableformAction			= null;			//数据表action
	private String			tableformtarget			= null;			//数据表target
	private String 			tablemethod				= null;			//数据表method
	private String 			textColor				= null;			//选择时字体颜色
	private String			backgroundColor			= null;			//背景色
	private String 			checks					= null;			//初始化选择
	private String			cells					= null;			//列选项
	private String			airRowClass				= null;			//根据单元格值，格式化单元格样式
	private String			airLenRowClass			= null;			//根据单元格值，格式化单元格所在的行样式
	private String 			onsuccess				= null;
	private String 			onfailure				= null;
	private String 			onsubmit				= null;
	private String			hideselect				= "false";		//是否隐藏选择列
	private String			reload					= null;			//是否开启手动刷新功能
	private List<CellParItem> Cellname				= null;			//列名
	private Integer			autoRefresh				= null;			//自动刷新时间，以秒为单位
	private String			outtitle                = null;         //导出文件时的标题
	private String 			dataclass				= null;			//自定义类返回数据
	private String 			inputData				= null;			//数据绑定
	private String 			formNull				= null;			//提交form为空时的提示信息
	private String 			formConfirmation		= null;			//显示确认信息
	private String 			isHideHead 				= null;			//是否隐藏表头
	private String			isHideBottom			= null;			//是否隐藏底部栏
	private String			editCells				= null;			//可编辑列 [{cell:22,cfg:{type:'input',allownull:'',chtype:'',veri:'',msg:''}},{cell:'user',{}}]
	private String			editSubmitColor			= null;			//编辑自动提交模式下的提示色{loadColor:'',successColor:'',failureColor:''}分别表示正在提交，提交成功，提交失败
	private String			endtSubmitAction		= null;			//编辑自动提交路径
	private String			editOnSubmit			= null;			//在提交时调用的外部方法
	private String			editOnReturn			= null;			//在返回时调用的外部方法
	private String			editRow					= null;			//是否开启编辑行
	private String			editAllSubmitAction		= null;			//表单全部提交地址
	private String			outfilename				= null;			//导出文件名称
	private String          outcustom				= null;         //导出统计栏
	private String			oninit					= null;			//初始化表格时调用的外部方法
	private String			onresize				= null;			//重设大小
	private String			autosize				="true";		//自适应大小
	private SelectCustom 	scfon 					=null;			//下拉框
	private String 			autowidth 				="true";		//自动列宽
	private String 			onSetSumValue 			= null;         //汇总列设置值的时候调用
	private String 			sumformatcell			= null;			//格式化汇总列
	private String			foldingLine 			= null;			//折行显示
	private String			flodingButton			= null;			//显示折行显示设置按钮
	private String 			insertBlankRow			= null;			//初始化时插入的空行数量
	private String 			editOnSubmitForm		= null;			//在编辑时需要提交数据的外部表单
	private String			editOnSubmitAll			= null;			//在编辑时，全部提交前调用的外部方法
	private String			sort					= null;			//是否启列排序，默认为true
	private String 			configid				= null;			//配置设置id
	private String 			minpage					= null;			//是否为迷你模式
	private String			pagecode				= null;			//页码数量
	private String			treesql					= null;         //树形grid时，增加子集的sql
	private String 			findtreenode            = null;			//树形grid时查询条件
	private String 			treecellwidth			= null;			//树形列宽度
	private String			sumsql					= null;			//树形状态下汇总列的sql sql|treesql
	private String 			ontreeclick				= null;			//树形表格节点单击事件
	private String			countsql				= null;			//获取汇总列的sql
	private String			dataurl					= null;			//数据加载url
	private String			subtableurl				= null;			//子表url
	private String			exporturl				= null;			//导出时的url
	private String			fxeidcell               = null;			//开启列锁定功能
	
	
	public int doStartTag()throws JspException{
		//==========基础对像=======================================================
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		Boolean isCellBody = false;
		StringBuilder body = new StringBuilder();
		body.append(potjs(request));
		body.append(dbjs(request));
		body.append(DbgridCSS(request));
		JspWriter jspOut= pageContext.getOut();
		String pautowidth = autowidth;
		if(null==sql){
			sql = "test";
		}
		//==========对弹出框作处理================================================
		try{
			if(this.getParent()  instanceof NokaBox){
				NokaBox ntg = (NokaBox)this.getParent();
				ntg.addGrid(new GridBoxItem(getId(),autosize,autowidth,ntg.getId()));
				width = ntg.getWidth();
				autowidth="false";
			}else if(this.getParent()  instanceof NHTMLBox){
				NHTMLBox ntg = (NHTMLBox)this.getParent();
				ntg.addGrid(new GridBoxItem(getId(),autosize,autowidth,ntg.getId()));
				width = ntg.getWidth();
				autowidth="false";
			}else{
				width = getWidth();
				autowidth=getAutowidth();
			}
		}catch(Exception se){}
		//=========获取用户设置列信息==============================================
		Boolean useCells = false;//是否使用用户定义
		NDBGridCellsDBUtil ndb = new NDBGridCellsDBUtil();
		String key  =  request.getRequestURI()+"_"+configid;
		ndb.CeeateFileTable(request);
		String setCells = ndb.getSet(key,request);
		String UFoldingLine = ndb.getFoldingLine(key, request);//是否折行显示
		String cellModel = tablehead(request);
		cellModel = (null==cellModel?"[]":"["+cellModel+"]");
		if(ndb.clearCells(key, cellModel,request)){//有用户自定义列设置则关闭自动列宽
			pautowidth="false";
			useCells = true;
		}else{
			pautowidth = autowidth;
			useCells=false;
		}
		//========================================================================
		try{
			if(this.getParent() instanceof SelectCustom){
				scfon = (SelectCustom)this.getParent();
				id=scfon.getId()+"_sboddiv";
				scfon.setHeight(getHeight());
			}else{
				scfon = null;
				id = getId();
				height = getHeight();
			}
		}catch(Exception se){
		}
		//==========处理方法=======================================================
		body.append(select(request));
		body.append(selectCss(request));
		body.append(selectjs(request));//select js
		body.append(treejs(request));//tree js
		body.append(selectButtonjs(request));//select js
		body.append(nkBoxJsAndCss(request));
		body.append(nkdateJS(request));//加载nkdateJS
		body.append(inputTextJS(request));//加载Prototype
		body.append(selectMultijs(request));//select-multi js
		body.append(multInputTextJS(request));//select-multi js
		body.append(ajaxinputTextJS(request));//select-multi js
		body.append(treeTranjs(request));//tree js
		body.append(nswitch(request));//switch
		//--------------------------------------------------------------------------
		String pwidth = LenFormat(width);
		body.append("<div style=\"width:100%;height:1px;overflow:hidden;\"  id=\"nk_"+id+"_size_width\"></div> ");//position:relative;
		body.append("<div style=\"width:0px;height:100%;top:0px;left:0px;overflow:hidden;position: absolute;z-index:9999;\"  id=\"nk_"+id+"_size_height\"></div> ");
		body.append("<div id=\"left_div_"+id+"\"></div> ");//position:relative;
		body.append("<div style=\"width:"+pwidth+";overflow:hidden;float: left;\"   class=\"nk_dbgrid_div\" id=\"div_"+id+"\"></div> ");//position:relative;
		String subStyle=subStyle(request);
		if(subStyle!=null){//子表
			body.append("<div style=\"display:none\" id=\""+id+"_sub_style_div\">"+subStyle+"</div>");
		}
		String CellBody=GetCellBody(request);
		if(CellBody!=null){//自定义主单元格
			body.append("<div style=\"display:none\" id=\""+id+"_cell_body_div\">"+CellBody.replace("${", "{")+"</div>");
			isCellBody = true;
		}
		body.append("<script type=\"text/javascript\">");
		body.append("var "+id+"dbModel = {");
		body.append("nkid : '"+id+"',");
		//-------------------全局选项-----------------------------------------------------------------------------
		body.append("options : {");
		body.append("title:'"+(title==null?"":title)+"',");//标题
		body.append("outtitle:'"+(outtitle==null?"":outtitle)+"',");//打印标题
		body.append("rooturl:'"+basepath(request)+"/nokatag',");//根路径
		body.append("sql:'"+AESPlus.encrypt(sql,Concest.SQLKEY)+"',");//sql语句
		if(null!=findtreenode){
			List<TreeGridItem> ltist =getTreePars(findtreenode);
			if(null!=ltist){
				Gson gson = new Gson();
				body.append("findtreenode:"+gson.toJson(ltist)+",");//树形查询
				body.append("treeselectfiled:'"+AESPlus.encrypt(findtreenode,Concest.SQLKEY)+"',");//树形查询
			}
		}
		if(null!=treesql){
			body.append("treesql:'"+AESPlus.encrypt(treesql,Concest.SQLKEY)+"',");//树形查询
		}
		if(null!=treecellwidth){
			body.append("treecellwidth:"+LenNumber(treecellwidth)+",");//树形查询
		}
		if(null!=sumsql){
			body.append("sumsql:'"+sumsql+"',");//树形查询
		}
		if(null!=countsql){
			body.append("countsql:'"+AESPlus.encrypt(countsql,Concest.SQLKEY)+"',");//或取总行数sql
		}
		body.append("ajaxPrave:'a=332&b=cccc',");//ajax提交附加参数
		body.append("height:'"+LenFormat(height)+"',");//高度
		body.append("width:'"+pwidth+"',");//宽度
		body.append("isCellBody:"+isCellBody+",");//自定义主表单元格
		body.append("pagesize:'"+(pagesize==null?"":pagesize)+"',");//页大小
		body.append("pagedescorname:'"+(compositor==null?"":compositor)+"',");//排序列
		body.append("custombutton:'"+(custombutton==null?"":custombutton.replace("\'","\""))+"',");//自定义按钮
		body.append("custom:'"+(custom==null?"":custom.replace("\'","\""))+"',");//自定义统计栏
		body.append("checkrecord:'"+(checkrecord==null?""+id+"_record":checkrecord)+"',");
		body.append("pagedescorasc:'"+(descorasc==null?"":descorasc)+"',");//排序方式 AES 或  DES
		body.append("onrowdblclick:function(row){"+(onrowdblclick==null?"":onrowdblclick+"(row);")+"},");//双
		body.append("onrowclick:function(row){"+(onrowclick==null?"":onrowclick+"(row);")+";},");//单
		body.append("formatcell:'"+(formatcell==null?"":AESPlus.encrypt(formatcell,Concest.SQLKEY))+"',");//格式化列
		body.append("sumformatcell:'"+(sumformatcell==null?"":AESPlus.encrypt(sumformatcell,Concest.SQLKEY))+"',");//格式化汇总列
		body.append("autosize:"+autosize+",");//自动适应大小
		if(null!=minpage){
			body.append("minpage:"+("true".equals(minpage))+",");
		}
		if(null!=pagecode){
			body.append("pagecode:"+pagecode+",");
		}
		if(null!=configid){
			body.append("setkey:'"+key+"',");
		}
		if(null!=scfon){
			body.append("selectMode:'"+scfon.getId()+"',");
		}
		if(null!=Cellname){
			Gson gson = new Gson();
			body.append("cellname:"+gson.toJson(Cellname)+",");
		}
		if(null!=fxeidcell){
			body.append("fxeidcell:"+fxeidcell+",");
		}
		if(null!=pautowidth){//自动列宽
			body.append("autowidth:"+pautowidth+",");
		}
		if(null!=autowidth){//自动列宽
			body.append("oautowidth:"+autowidth+",");
		}
		if(null!=onSetSumValue){//汇总列设置值时调用
			body.append("onSetSumValue: function(cellname,value){return "+onSetSumValue+"(cellname,value);},");
		}
		if(null!=UFoldingLine){//用户自定义配置
			body.append("foldingLine:"+("true".equals(UFoldingLine))+",");
		}else if(null!=foldingLine){
			body.append("foldingLine:"+("true".equals(foldingLine))+",");
		}
		if(null!=flodingButton){
			body.append("flodingButton:"+("true".equals(flodingButton))+",");
		}
		if(null!=editOnSubmitForm){
			body.append("editOnSubmitForm:'"+editOnSubmitForm+"',");//编辑需要提交外部表单
		}
		if("true".equalsIgnoreCase(selectinput) && selectfiled!=null && selectfiled.trim().length()>0){
			body.append("nkselect:'nk_"+id+"_select_div',");//查询
			body.append("selectfiled:'"+AESPlus.encrypt(selectfiled,Concest.SQLKEY)+"',");//查询
		}else if(selectfiled!=null && selectfiled.trim().length()>0){
			body.append("nkselect:'"+selectinput+"',");//查询
			body.append("selectfiled:'"+AESPlus.encrypt(selectfiled,Concest.SQLKEY)+"',");//查询
		}else{
			body.append("nkselect:'',");//查询
			body.append("selectfiled:'',");//查询
		}
		if(inputData!=null){
			body.append("inputData:"+inputData+",");//数据绑定
		}
		if(null!=oninit){
			body.append("oninit:function(a){"+(oninit==null?"":oninit+"(a);")+"},");//初始化时调用的外部方法
		}
		if(onload!=null){
			body.append("onDataLoad:'"+AESPlus.encrypt(onload,Concest.SQLKEY)+"',");//在加载数据时调用的后台方法
		}
		if(outfilename!=null){
			body.append("outfilename:'"+AESPlus.encrypt(outfilename,Concest.SQLKEY)+"',");//导出文件名称
		}
		if(null!=onresize){
			body.append("onresize:function(a){"+(onresize==null?"":onresize+"(a);")+"},");//大小改变
		}
		if(null!=outcustom){
			body.append("outcustom:'"+outcustom+"',");//导出统计栏
		}
		if(null!=editOnSubmitAll){
			body.append("editOnSubmitAll:function(a){return "+editOnSubmitAll+"(a);},");
		}else{
			body.append("editOnSubmitAll:function(a){return {submit:true};},");
		}
		if(null!=insertBlankRow){
			Integer sn = 0;
			try{sn = Integer.parseInt(insertBlankRow);}catch(Exception se){}
			body.append("insertBlankRow:"+sn+",");//初始化时插入的空行数量
		}
		if(null!=sort){
			body.append("sort:"+sort+",");
		}
		if(null!=dataurl){
			body.append("dataurl:'"+dataurl+"',");
		}
		if(null!=subtableurl){
			body.append("subtableurl:'"+subtableurl+"',");
		}
		if(null!=exporturl){
			body.append("exporturl:'"+exporturl+"',");
		}
		
		body.append("onend:function(a,b){"+(onend==null?"":onend+"(a,b);")+"},");//
		body.append("formNull:'"+(formNull==null?"":formNull)+"',");//form提交为空时的提示信息
		body.append("formConfirmation:'"+(formConfirmation==null?"":formConfirmation)+"',");//form提交确认信息
		body.append("outexcelnopage:'"+(outexcelnopage==null?"":outexcelnopage)+"',");
		body.append("outexcelall:'"+(outexcelall==null?"":outexcelall)+"',");
		body.append("outcsvnopage:'"+(outcsvnopage==null?"":outcsvnopage)+"',");//csv
		body.append("outcsvall:'"+(outcsvall==null?"":outcsvall)+"',");//csv
		body.append("outpdfnopage:'"+(outpdfnopage==null?"":outpdfnopage)+"',");//pdf
		body.append("outpdfall:'"+(outpdfall==null?"":outpdfall)+"',");//pdf
		body.append("outuserfile:'"+(outuserfile==null?"":AESPlus.encrypt(outuserfile,Concest.SQLKEY))+"',");//自定义数据接口
		body.append("checkvalue:'"+(checkvalue==null?"":checkvalue)+"',");
		body.append("checkname:'"+(checkname==null?"":checkname)+"',");
		body.append("tableformname:'"+(tableformname==null?"":tableformname)+"',");
		body.append("tableformid:'"+(tableformid==null?"":tableformid)+"',");
		body.append("tableformAction:'"+(tableformAction==null?"":tableformAction)+"',");
		body.append("tableformtarget:'"+(tableformtarget==null?"":tableformtarget)+"',");
		body.append("tablemethod:'"+(tablemethod==null?"":tablemethod)+"',");
		body.append("textColor:'"+(textColor==null?"":textColor)+"',");
		body.append("backgroundColor:'"+(backgroundColor==null?"":backgroundColor)+"',");
		body.append("checks:'"+(checks==null?"":checks)+"',");
		body.append("dataclass:'"+(dataclass==null?"":AESPlus.encrypt(dataclass,Concest.SQLKEY))+"',");
		body.append("reload:'"+("true".equalsIgnoreCase(reload)?"true":"")+"',");
		body.append("onfailure:function(a){"+(onfailure==null?"":onfailure+"(a);")+"},");
		body.append("onsuccess:function(a){"+(onsuccess==null?"":onsuccess+"(a);")+"},");
		body.append("onsubmit:function(a){"+(onsubmit==null?"return true;":"return "+onsubmit+"(a);")+"},");
		body.append("onloadjs:function(a,b){"+(onloadjs==null?"return true;":"return "+onloadjs+"(a,b);")+"},");
		body.append("treeclick:function(a,b){"+(ontreeclick==null?"return true;":"return "+ontreeclick+"(a,b);")+"},");
		if(null!=checkd && ("checkbox".equals(checkd) || "radio".equals(checkd)) ){
			body.append("checkd:'"+checkd+"',");
		}
		if(null!=editCells)
			body.append("editCells:"+editCells+",");//编辑列
		body.append("editSubmitColor:"+(null==editSubmitColor?"{loadColor:'#008800',successColor:'',failureColor:'#FF0000'}":editSubmitColor)+",");//编辑提交颜色
		if(null!=endtSubmitAction)
			body.append("endtSubmitAction:'"+endtSubmitAction+"',");//编辑提交路径
		if(null!=editAllSubmitAction && editAllSubmitAction.trim().length()>0)
			body.append("editAllSubmitAction:'"+editAllSubmitAction+"',");//编辑提交路径
		if(null!=editRow){
			if("true".equalsIgnoreCase(editRow)){//true
				body.append("editRow:{addEdit:true,delEdit:true},");//编辑提交路径true true,false
			}else if("false".equalsIgnoreCase(editRow)){//true
				body.append("editRow:{addEdit:false,delEdit:false},");//编辑提交路径true true,false
			}else if("true,false".equalsIgnoreCase(editRow)){//true
				body.append("editRow:{addEdit:true,delEdit:false},");//编辑提交路径true true,false
			}else if("false,true".equalsIgnoreCase(editRow)){//true
				body.append("editRow:{addEdit:false,delEdit:true},");//编辑提交路径true true,false
			}else if("false,false".equalsIgnoreCase(editRow)){//true
				body.append("editRow:{addEdit:false,delEdit:false},");//编辑提交路径true true,false
			}else if("true,true".equalsIgnoreCase(editRow)){//true
				body.append("editRow:{addEdit:true,delEdit:true},");//编辑提交路径true true,false
			}
		}
		body.append("editOnSubmit:function(a){"+(editOnSubmit==null?"return {submit:true};":"return "+editOnSubmit+"(a);")+"},");//在提交调用的外部方法
		body.append("editOnReturn:function(a,b){"+(editOnReturn==null?"":editOnReturn+"(a,b);")+"},");//在返回时调用的外部方法
		if(null!=isHideHead)
			body.append("idHideHead:"+("true".equalsIgnoreCase(isHideHead))+",");//是否隐藏表头
		if(null!=isHideBottom)
			body.append("isHideBottom:"+("true".equalsIgnoreCase(isHideBottom))+",");//是否隐藏底部
		body.append("autoRefresh:'"+(autoRefresh==null?"0":autoRefresh)+"'");//自动定时刷新
		body.append("},");
		//-------------------子表选项----------------------------------------------------------------------------
		if(subtabletype!=null && subtable!=null){
		body.append("subTable : {");
		body.append("subtabletype:'"+subtabletype+"',");
		body.append("subtablestyleid:'"+(subtablestyleid==null?"":subtablestyleid)+"',");
		body.append("subtable:'"+subsql(request)+"',");
		body.append("onloadsubtable:function(a){"+(null==onloadsubtable?"":"return "+onloadsubtable+"(a);")+"},");
		body.append("subformatcell:'"+(subformatcell==null?"":AESPlus.encrypt(subformatcell,Concest.SQLKEY))+"'");//
		body.append("},");
		}
		//-------------------附加列-----------------------------------------------------------------------------	
		body.append("syscells : [");
		body.append(syscells(request));
		body.append("],");
		//-------------------lanage选项-------------------------------------------------------------------------	
		body.append("lanage : {");
		body.append("Lanage_nodainfo:'"+Function.lung(request,"org_nokatag_grid_25")+"',");//没有数据
		body.append("Lanage_number:'"+Function.lung(request,"org_nokatag_grid_2")+"',");//序号
		body.append("Lanage_AllSelect:'"+Function.lung(request,"org_nokatag_grid_1")+"',");//全选
		body.append("Lanage_firstImg:'"+Function.lung(request,"org_nokatag_grid_8")+"',");//第一页
		body.append("Lanage_topImg:'"+Function.lung(request,"org_nokatag_grid_16")+"',");//前10页
		body.append("Lanage_aftImg:'"+Function.lung(request,"org_nokatag_grid_17")+"',");//后10页
		body.append("Lanage_endImg:'"+Function.lung(request,"org_nokatag_grid_11")+"',");//最后一页
		body.append("Lanage_pageAlink:'"+Function.lung(request,"org_nokatag_grid_18")+"{i}"+Function.lung(request,"org_nokatag_grid_19")+"',");//最后一页
		body.append("Lanage_PageInfo:'"+Function.lung(request,"org_nokatag_grid_12")+"{showPage}/{pageConut}&nbsp;"+Function.lung(request,"org_nokatag_grid_13")+"{newpagesize}/{newpagestartnumber}-{newpagesendnumber}"+Function.lung(request,"org_nokatag_grid_14")+"&nbsp;"+Function.lung(request,"org_nokatag_grid_15")+"{lastRow}"+Function.lung(request,"org_nokatag_grid_14")+"', ");//最后一页
		body.append("Lanage_outexcelPage:'"+Function.lung(request,"org_nokatag_grid_5")+"',");//最后一页
		body.append("Lanage_outexcelAll:'"+Function.lung(request,"org_nokatag_grid_6")+"',");//最后一页
		body.append("Lanage_setimagell:'"+Function.lung(request,"org_nokatag_grid_7")+"',");//最后一页
		body.append("Lanage_sequAsc:'"+Function.lung(request,"org_nokatag_grid_3")+"',");//最后一页
		body.append("Lanage_sequDesc:'"+Function.lung(request,"org_nokatag_grid_4")+"',");//最后一页
		body.append("Lanage_loaddata:'"+Function.lung(request,"org_nokatag_grid_28")+"',");//正在加载数据
		body.append("Lanage_outcsvPage:'"+Function.lung(request,"org_nokatag_grid_29")+"',");//到出CSV
		body.append("Lanage_outcsvAll:'"+Function.lung(request,"org_nokatag_grid_30")+"',");//到出CSV
		body.append("Lanage_outpdfPage:'"+Function.lung(request,"org_nokatag_grid_31")+"',");//到出当前页pdf
		body.append("Lanage_outpdfAll:'"+Function.lung(request,"org_nokatag_grid_32")+"',");//到出pdf
		body.append("Lanage_reload:'"+Function.lung(request,"org_nokatag_grid_27")+"',");//刷新数据
		body.append("Lanage_addRow:'"+Function.lung(request,"org_nokatag_grid_33")+"',");//添加行
		body.append("Lanage_delRow:'"+Function.lung(request,"org_nokatag_grid_34")+"',");//删除行
		body.append("Lanage_EditSubmit:'"+Function.lung(request,"org_nokatag_grid_35")+"',");//保存
		body.append("Lanage_SelectClear:'"+Function.lung(request,"org_nokatag_grid_36")+"',");//清除
		body.append("Lanage_flodingButton:'"+Function.lung(request,"org_nokatag_grid_37")+"',");//折行显示
		body.append("Lanage_slang:'"+Function.lung(request,"org_nokatag_select_pleaseselect")+"',");//选择语言
		body.append("Lanage_sclose:'"+Function.lung(request,"org_nokatag_select_close")+"',");//选择语言
		body.append("Lanage_sclear:'"+Function.lung(request,"org_nokatag_select_clear")+"',");//选择语言
		body.append("Lanage_clearButton:'"+Function.lung(request,"org_nokatag_grid_38")+"',");//清除设置
		body.append("Lanage_fxied:'"+Function.lung(request,"org_nokatag_grid_39")+"',");//固定列
		body.append("Lanage_show:'"+Function.lung(request,"org_nokatag_grid_40")+"',");//显示列
		body.append("Lanage_title:'"+Function.lung(request,"org_nokatag_grid_41")+"'");//列标题
		body.append("},");
		//--------------------列选项----------------------------------------------------------------------------
		body.append("colinitModel:"+cellModel+",");
		if(useCells){
			body.append("columnModel :"+setCells);
		}else{
			body.append("columnModel :"+cellModel);
		}
		body.append("};");
		//--------------------初始化---------------------------------------------------------------------------		
		body.append("Event.observe(document, 'dom:loaded', function() {");
		body.append("var "+id+"tableGrid = new NKDBGrid("+id+"dbModel);");
		body.append(""+id+"tableGrid.show('div_"+id+"');");
		body.append("});");
		body.append("function "+id+"_reLoadData(){$('nk_"+id+"_reLoadData').click();}");
		body.append((onsuccess==null || onfailure==null)?"":"function "+id+"_ajaxSubmitDataForm(){$('nk_"+id+"_AjaxSubmitDataForm').click();}");
		body.append("</script>");
		//==========输出到页面=====================================================
		try{
			jspOut.write(body.toString());
		}catch(Exception se){
			
		}
		return EVAL_BODY_INCLUDE;
	}
	protected String tablehead(HttpServletRequest request){
		StringBuffer body = new StringBuffer();
		List<CellParItem> cellDB = null;
		try{cellDB=NDBGridUtil.getCellType(request,sql);}catch(Exception e){}
		Cellname = cellPar(request,cellDB);
		Map<String,Map<String,String>> airMap=null;
		Map<String,Map<String,String>> airLenMap=null;
		if(airRowClass!=null && airRowClass.trim().length()>0)
			airMap=Function.StringToMaps(airRowClass);//控件组
		if(airLenRowClass!=null && airLenRowClass.trim().length()>0)
			airLenMap=Function.StringToMaps(airLenRowClass);//控件组
		String[] cellsName = (null!=cells?cells.split("\\|"):new String[0]);
		//------------------------------------------------------------------------
		for(int i=0;i<Cellname.size();i++){
			if(i<cellsName.length)
				body.append("{title : '"+Cellname.get(i).getCellname()+"',"+cellStr(cellsName[i],cellDB,i)+",aircell:"+getAirscell(airMap,Cellname.get(i).getName())+",airlencell:"+getAirscell(airLenMap,Cellname.get(i).getName())+"},");
			else if(cellsName.length<1){
				body.append("{title : '"+Cellname.get(i).getCellname()+"',name:'"+Cellname.get(i).getName()+"',width : 100,show:1,aircell:"+getAirscell(airMap,Cellname.get(i).getName())+",airlencell:"+getAirscell(airLenMap,Cellname.get(i).getName())+"},");
			}else{
				body.append("{title : '"+Cellname.get(i).getCellname()+"',name:'"+Cellname.get(i).getName()+"',width : 100,show:4,aircell:"+getAirscell(airMap,Cellname.get(i).getName())+",airlencell:"+getAirscell(airLenMap,Cellname.get(i).getName())+"},");
			}
		}
		//------------------------------------------------------------------------
		if(body.length()>2)
			return body.substring(0,body.length()-1);
		return body.toString();
	}

	// -------------------------解析列配置------------------------------------------------------------
	protected List<CellParItem> cellPar(HttpServletRequest request,List<CellParItem> cellNames) {
		List<CellParItem> cellPars = new ArrayList<CellParItem>();
		String[] cellsName = (null!=cells?cells.split("\\|"):new String[0]);
		//-------------------数据库获取的列名不为空，则以数据库列名为准--------------------------------
		if(null!=cellNames && !cellNames.isEmpty()){
			int index = 0;
			for(CellParItem cel:cellNames){//数据库实际列
				if(index<cellsName.length){//当数据库列比配置列长度要小时，合并配置参数
					Gson gson = new Gson();
					CellInitItem cellInit = null;
					try{cellInit = gson.fromJson("{"+parCellStr(cellsName[index])+"}", CellInitItem.class);}catch(Exception e){}	
					if(null!=cellInit){
						if(null==cellInit.getTitle() || null==cellInit.getName()){
							cellPars.add(new CellParItem(cel.getType(), cel.getCellname(),cel.getName()));//标题或列名为空以数据库为准
						}else if(null!=cellInit.getTitle() && null!=cellInit.getName()){
							cellPars.add(new CellParItem(java.sql.Types.VARCHAR, cellInit.getTitle(),cellInit.getName()));//设置了标题和列名时以设置参数为准
						}
					}else{
						cellPars.add(new CellParItem(cel.getType(), cel.getCellname(),cel.getName()));//转换错误以数据库为准
					}
				}else{ //大于配置列的以数据库为准
					cellPars.add(new CellParItem(cel.getType(), cel.getCellname(),cel.getName()));//超进列以数据库为准
				}
				index++;
			}
		}else if (null != cells) {
			for (String cell : cellsName) {
				Gson gson = new Gson();
				CellInitItem cellInit = null;
				try{cellInit = gson.fromJson("{"+parCellStr(cell)+"}", CellInitItem.class);}catch(Exception se){}
				if(null!=cellInit && null!=cellInit.getTitle() && null!=cellInit.getName()){
					cellPars.add(new CellParItem(java.sql.Types.VARCHAR, cellInit.getTitle(),cellInit.getName()));
				}
			}
		}
		return cellPars;
	}
	//------------------------列设置字符串-----------------------------------------------------------
	protected String cellStr(String air,List<CellParItem> cellDB,int idx){
		String rstr = "";
		if(null!=air){
			String[] acell = air.split(",");
			for(String ac:acell){
				if(!ac.startsWith("title:")){
					if(ac.startsWith("name:")){
						rstr+=","+ac;
					}else{
						rstr+=","+ac;
					}
				}
			}
			if(rstr.indexOf("name:")==-1){
				try{
					if(null!=cellDB && cellDB.size()>idx){
						rstr=",name:'"+cellDB.get(idx).getName()+"'"+rstr;
					}
				}catch(Exception e){}
			}
			return rstr.substring(1);
		}
		return "";
	}
	//---------------------列配置字符串，不含fmt----------------------------------------------------
	protected String parCellStr(String cestr){
		String rstr = "";
		if(null!=cestr){
			String[] acell = cestr.split(",");
			for(String ac:acell){
				if(!ac.startsWith("fmt:")){
					if(ac.startsWith("name:") && ac.indexOf(":")!=-1){
						rstr+=","+ac;
					}else if(ac.indexOf(":")!=-1){
						rstr+=","+ac;
					}
				}
			}
			return rstr.substring(1);
		}
		return "";
	}
	//=========================附加列================================================================
	protected String syscells(HttpServletRequest request){
		StringBuffer body = new StringBuffer();
		if(subtabletype != null & subtable != null){//子表
			body.append("{title : '',width : 24,type: 1,show:2}, ");//1显示/可选择    2显示/不可选择,3不显示/可选择   4不显示/不可选择
		}
		if("true".equalsIgnoreCase(number)){//序号
			body.append("{title : '"+Function.lung(request,"org_nokatag_grid_2")+"',width : 40,type: 2,show:2}, ");
		}
		if("radio".equalsIgnoreCase(checkd)){//单选
			body.append("{title : '"+Function.lung(request,"org_nokatag_grid_21")+"',width : 40,type: 3,show:"+("true".equalsIgnoreCase(hideselect)?"4":"2")+"}, ");
		}
		if("checkbox".equalsIgnoreCase(checkd)){//多选
			body.append("{title : '"+Function.lung(request,"org_nokatag_grid_1")+"',width : 65,type: 4,show:"+("true".equalsIgnoreCase(hideselect)?"4":"2")+"}, ");
		}
		if(null!=treesql){//树形表
			body.append("{title : '',width :"+(null!=treecellwidth?"100":LenNumber(treecellwidth))+",type:5,show:2}, ");//1显示/可选择    2显示/不可选择,3不显示/可选择   4不显示/不可选择
		}
		if(body.length()>2){
			return body.substring(0,body.length()-2);
		}
		return body.toString();
	}
	@SuppressWarnings("rawtypes")
	protected String getAirscell(Map<String,Map<String,String>> airMap,String cellName){
		String dclassid="[";
		if(airMap!=null && !airMap.isEmpty()){//menutaxis
			Map<String,String> cmap = airMap.get(cellName);
			if(cmap!=null){
			 Set<String> key = cmap.keySet();        
			 for (Iterator it = key.iterator(); it.hasNext();){       
				 String ke= (String) it.next();      
				 dclassid+="{key:'"+ke+"',cl:'"+cmap.get(ke)+"'},";        
			 }
			}
			 if(dclassid.length()>10)
				 dclassid=dclassid.substring(0,dclassid.length()-1);
		}
		dclassid+="]";
		return dclassid;
	}
	//=========================子表样式==============================================================
	protected String subStyle(HttpServletRequest request){
		if("cell".equalsIgnoreCase(subtabletype) && subtable != null && subtablestyleid!=null){
	    	String bodystr = GridStyle.GetSubStyle(Integer.parseInt(subtablestyleid), request);
	    	if(bodystr!=null && bodystr.trim().length()>0){
	    		return bodystr;
	    	}
		}
		return null;
	}
	//=========================自定义主表单元格======================================================
	protected String GetCellBody(HttpServletRequest request){
		if(cellbody!=null){
	    	String bodystr = GridStyle.GetCellBody(Integer.parseInt(cellbody), request);
	    	if(bodystr!=null && bodystr.trim().length()>0){
	    		return bodystr;
	    	}
		}
		return null;
	}
	//=========================子表处理==============================================================
	protected String subsql(HttpServletRequest request){
		if(subtable!=null && ("sql".equalsIgnoreCase(subtabletype) || "class".equalsIgnoreCase(subtabletype))){
			return AESPlus.encrypt(subtable,Concest.SQLKEY);
		}
		return subtable;
	}
	//========================查询===================================================================
	protected String select(HttpServletRequest request){
		StringBuffer body = new StringBuffer();
		Boolean isShowButton=false;//是否显示查讯按钮
		body.append("");
		String pwidth = LenFormat(width);
		if (selectfiled != null && selectfiled.trim().length() > 1&& selectfiled.indexOf(",") != 1 && "true".equalsIgnoreCase(selectinput)) {
			body.append("<div  id=\"nk_"+id+"_select_div\" width=\""+pwidth+"\" style=\"width:"+pwidth+";\" class=\"nk_select_div\" >\n");
			body.append(" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
			body.append("  <tr><td  nowrap=\"nowrap\">\n");
			body.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\">\n");
			String[] selectfiled_row = selectfiled.split("\\$n");
			int row=0;
			for(String selectfiledn:selectfiled_row){
				body.append("<tr>\n");
				row++;//行数
				//------------------组织查询界面-----------------------------
				List<String> fildenames = new ArrayList<String>();
				String[] selectnums = selectfiledn.split("\\|");//分隔查询条件,形如 #[name,1^第一级!2^第二级]# like '%$[name,中文名,list,1^第一级!2^第二级]%'
				for(int i=0;i<selectnums.length;i++){
					//------------------查询条件---------------------------------
					 if(selectnums[i].indexOf("#[")!=-1){
						 try {
							 String s = selectnums[i].substring(selectnums[i].indexOf("#[")+2,selectnums[i].indexOf("]#"));
							 String sn = s.split(",")[0];//名字
							 String[] sv = s.split(",")[1].split("\\!");//形如 1^第一级
							 body.append("<td  nowrap=\"nowrap\" >");
							 body.append(selectCreate(request,sn,sv,40,false,null));
							 body.append("</td>");
						 }catch (Exception s) {
						}
					 }
					 //-------------------查询值----------------------------------
					 if(selectnums[i].indexOf("$[")!=-1){
						 try {
							 String s = selectnums[i].substring(selectnums[i].indexOf("$[")+2,selectnums[i].lastIndexOf("]"));//形如 name,中文名,list,1^第一级!2^第二级
							 String sn = s.split(",")[0];//名字
							 String sti = s.split(",")[1];//中文名
							 String sty = "text";//类型 查询框类型{text | list | date |datetime|time|button|hidden|tree|minput }
							 String[] sv = {""};//值
							 if(s.split(",").length==3){
								  sty = s.split(",")[2];//类型
							 }else if(s.split(",").length>=4){
								  sty = s.split(",")[2];//类型
								  sv = s.split(",")[3].split("\\!");//值
							 }
							if(sty.equalsIgnoreCase("text") || sty.equalsIgnoreCase("mtext")){//一般录入框,sv为验证的正则表达式
								Integer width = 120;
								try{
									String bwidth = s.split(",")[4];
									String BWidth=(bwidth.endsWith("px")?bwidth.substring(0,bwidth.length()-2):bwidth);
									width = Integer.parseInt(BWidth);
								}catch(Exception ee){}//
								if(sti.trim().length()<1)
									body.append("<td  nowrap=\"nowrap\" >" + sti+ "</td><td>");
								else
									body.append("<td  nowrap=\"nowrap\" >" + sti+ ":</td><td>");
								String vp ="";
								for(String v:sv){
									vp+=v+",";
								}
								if(vp.endsWith(","))
									vp=vp.substring(0,vp.length()-1);
								body.append(InputCreate(request,sn,vp,width));
								body.append("</td>");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("hidden")){//一般录入框,sv为验证的正则表达式
								body.append("<td  nowrap=\"nowrap\" ><input type=\"hidden\" class=\"select_input\"  name=\""+ sn + "\" id=\""+sn+"_id\"  value=\""+sv[0]+"\" /></td>\n");
							}else if(sty.equalsIgnoreCase("list")){//下拉选框
								if(sti.trim().length()<1)
									body.append("<td  nowrap=\"nowrap\" >" + sti+ "</td><td  nowrap=\"nowrap\">");
								else
									body.append("<td  nowrap=\"nowrap\" >" + sti+ ":</td><td  nowrap=\"nowrap\">");
								Integer width = 120;
								String lower = null;
								try{
									String bwidth = s.split(",")[4];
									String BWidth=(bwidth.endsWith("px")?bwidth.substring(0,bwidth.length()-2):bwidth);
									width = Integer.parseInt(BWidth);
								}catch(Exception ee){}
								try{
									lower = s.split(",")[5];
								}catch(Exception ee){}
								body.append(selectCreate(request,sn,sv,width,true,lower));
								body.append("</td>");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("multi")){
								if(sti.trim().length()<1)
									body.append("<td  nowrap=\"nowrap\" >" + sti+ "</td><td  nowrap=\"nowrap\">");
								else
									body.append("<td  nowrap=\"nowrap\" >" + sti+ ":</td><td  nowrap=\"nowrap\">");
								Integer width = 120;
								try{
									String bwidth = s.split(",")[4];
									String BWidth=(bwidth.endsWith("px")?bwidth.substring(0,bwidth.length()-2):bwidth);
									width = Integer.parseInt(BWidth);
								}catch(Exception ee){}
								body.append(selectMultiCreate(request,sn,sv,width,true));
								body.append("</td>");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("date")){//日期选框
								body.append("<td  nowrap=\"nowrap\" >\n");
								
								if(sv[0].equalsIgnoreCase("today")){//当前时间
									Date d = new Date();
									String format="yyyy-MM-dd";
							    	SimpleDateFormat bartDateFormat = new SimpleDateFormat(format);
									sv[0]=bartDateFormat.format(d);
								}
								if(sti.trim().length()>0)
									body.append(sti+ ":");//名字
								body.append("</td><td nowrap=\"nowrap\"></td><td>");//名字
								body.append(DateCreate(request,sn,"dateFmt:'yyyy-MM-dd'",sv[0],80));
								body.append("</td>\n");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("datetime")){//日期时间选框
								body.append("<td  nowrap=\"nowrap\" >\n");
								if(sv[0].equalsIgnoreCase("today")){//当前时间
									Date d = new Date();
									String format="yyyy-MM-dd HH:mm:ss";
							    	SimpleDateFormat bartDateFormat = new SimpleDateFormat(format);
									sv[0]=bartDateFormat.format(d);
								}
								if(sti.trim().length()>0)
									body.append(sti+ ":");//名字
								body.append("</td><td nowrap=\"nowrap\"></td><td>");//名字
								body.append(DateCreate(request,sn,"dateFmt:'yyyy-MM-dd HH:mm:ss'",sv[0],135));
								body.append("</td>\n");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("time")){//时间选框
								body.append("<td  nowrap=\"nowrap\" >\n");
								if(sv[0].equalsIgnoreCase("today")){//当前时间
									Date d = new Date();
									String format="HH:mm:ss";
							    	SimpleDateFormat bartDateFormat = new SimpleDateFormat(format);
									sv[0]=bartDateFormat.format(d);
								}
								if(sti.trim().length()>0)
									body.append(sti+ ":");//名字
								body.append("</td><td nowrap=\"nowrap\"></td><td>");//名字
								body.append(DateCreate(request,sn,"dateFmt:'HH:mm:ss'",sv[0],65));
								body.append("</td>\n");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("button")){//弹出选择
								String width = s.split(",")[3];//宽
								String bwidth = s.split(",")[4];//弹出框的宽
								String bheight = s.split(",")[5];//弹出框的高
								String url = s.split(",")[6];//加载的url
								if(sti.trim().length()<1)
									body.append("<td  nowrap=\"nowrap\" >" + sti+ "</td><td  nowrap=\"nowrap\" >");
								else
									body.append("<td  nowrap=\"nowrap\" >" + sti+ ":</td><td  nowrap=\"nowrap\" >");
								body.append(SelectButton(request,sn,width,bwidth,bheight,url));
								body.append("</td>");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("tree")){//下拉树选择
								String sql_s = s.split(",")[3];//sql
								String width_s= (s.split(",").length>4?s.split(",")[4]:null);//rootid
								String rootid_s = (s.split(",").length>5?s.split(",")[5]:null);//width
								String cty_s = (s.split(",").length>6?s.split(",")[6]:null);//width
								body.append("<td  nowrap=\"nowrap\" >" + sti+ ":</td><td  nowrap=\"nowrap\" >");
								body.append(treeSelect(request,sn,sql_s,rootid_s,width_s,cty_s));
								body.append("</td>");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("minput")){//name,中文名,list,1^第一级!2^第二级
								String sql = s.split(",")[3];//sql
								String length = (s.split(",").length>4?s.split(",")[4]:null);//length
								String width = (s.split(",").length>5?s.split(",")[5]:null);//width
								if(sti.trim().length()<1)
									body.append("<td  nowrap=\"nowrap\" >" + sti+ "</td><td  nowrap=\"nowrap\" >");
								else
									body.append("<td  nowrap=\"nowrap\" >" + sti+ ":</td><td  nowrap=\"nowrap\" >");
								body.append(ajaxinput(request,sn,sql,length,width));
								body.append("</td>");
								isShowButton=true;
							}else if(sty.equalsIgnoreCase("treetran")){//下拉树选择
								String sql_s = s.split(",")[3];//sql
								String width_s= (s.split(",").length>4?s.split(",")[4]:null);//rootid
								String rootid_s = (s.split(",").length>5?s.split(",")[5]:null);//width
								String cty_s = (s.split(",").length>6?s.split(",")[6]:null);//width
								body.append("<td  nowrap=\"nowrap\" >" + sti+ ":</td><td  nowrap=\"nowrap\" >");
								body.append(treeTranSelect(request,sn,sql_s,rootid_s,width_s,cty_s));
								body.append("</td>");
								isShowButton=true;
							}
							fildenames.add(sn);
						}catch (Exception s) {
						}
					 }
				}
				if(row<selectfiled_row.length)
					body.append("</tr>\n");
				else{
					//------------------------------------------------------------
					if(selecttitle==null){
						selecttitle=Function.lung(request,"org_nokatag_grid_26");
					}
					if(isShowButton)
						body.append("<td><input type=\"Submit\" name=\"Submit\" id=\"nk_"+id+"_select_button\" value=\""+selecttitle+"\" class=\"select_button\" /></td>\n");
					else
						body.append("<td style=\"display: none;\"><input type=\"Submit\" name=\"Submit\" id=\"nk_"+id+"_select_button\" value=\""+selecttitle+"\" class=\"select_button\" /></td>\n");
					body.append("</tr></table>\n");
				}
			}//换行
			
			body.append("</td></tr></table>\n");
			body.append("</div>\n");
		} 
		return body.toString();
	}
	/**
	 * 普通录入框
	 * @param request
	 * @param name
	 * @param v
	 * @param width
	 * @return
	 */
	protected String InputCreate(HttpServletRequest request,String name,String v,Integer width){
		StringBuilder stringBuilder = new StringBuilder();
		String basePath = basepath(request);
		stringBuilder.append(potjs(request));//加载Prototype
		stringBuilder.append(inputTextJS(request));//加载Prototype
		stringBuilder.append("<div style=\"float: left;\">");
		stringBuilder.append("<div id=\""+name+"_maxDiv\" style=\"position:absolute;-moz-border-radius:5px; border-radius:5px;\"></div>");//放大效果的div
		stringBuilder.append("<div id=\""+name+"_sdDiv\" class=\"nk_input_lineheight nk_input_sdDiv\" style=\"width:"+width+";\">");
		stringBuilder.append("<input type=\"text\" class=\"nk_input_lineheight nk_input_text\"  id=\""+name+"\" name=\""+name+"\" style=\"width:"+width+"\"  value=\""+v+"\" /></div>");
		stringBuilder.append("<div style=\"float: left;\"><img id=\""+name+"_img\"/></div><div id=\""+name+"_div\" style=\"display:none;float: left;\"></div>");
		stringBuilder.append("</div>");
		stringBuilder.append("<script type=\"text/javascript\">");
		stringBuilder.append("Event.observe(document, 'dom:loaded', function() {");
		stringBuilder.append("var cfgs"+name+" = {id:'"+name+"',chtype:'',verification:'',allownull:true,rurl:'"+basePath+"'};");
		stringBuilder.append("var np"+name+" = new ninput(cfgs"+name+");");
		stringBuilder.append("np"+name+".initinput();");
		stringBuilder.append("});");
		stringBuilder.append("</script>");
		return stringBuilder.toString();
	}
	/**
	 * 时间
	 * @param request
	 * @param name
	 * @param prave
	 * @param width
	 * @return
	 */
	protected String DateCreate(HttpServletRequest request,String name,String prave,String v,Integer width){
		StringBuilder stringBuilder = new StringBuilder();
		String basePath = basepath(request);
		stringBuilder.append(potjs(request));//加载Prototype
		stringBuilder.append(nkdateJS(request));//加载nkdateJS
		stringBuilder.append(selectCss(request));
		stringBuilder.append("<div  style=\"float: left;\">");
		stringBuilder.append("<div  class=\"date-dropdownchecklist\"  id=\""+name+"_sdDiv\" onClick=\"WdatePicker({el:'"+name+"', "+prave+" })\" style=\"width:"+width+"px;float: left;overflow:hidden;\">");
		stringBuilder.append("<input type=\"text\" id=\""+name+"\" name=\""+name+"\"  class=\"nk_input_lineheight nk_select_input_text\" style=\"width:"+width+"px;\" value=\""+v+"\"/>");
		stringBuilder.append("</div>");
		stringBuilder.append("<div id=\""+name+"_dadiv\" style=\"float: left;\"></div>");
		stringBuilder.append("</div>");
		//------------------系统验证方法-----------------------------------------------------------
		stringBuilder.append("<script type=\"text/javascript\">");
		//---------------显示树形菜单---------------------------
		stringBuilder.append("Event.observe(document, 'dom:loaded', function() {");
		stringBuilder.append("var nda"+name+" = {");
		stringBuilder.append("id:'"+name+"',");//id
		stringBuilder.append("rurl:'"+basePath+"',");//根url
		stringBuilder.append("allownull:true");
		stringBuilder.append("};");
		stringBuilder.append("var nd"+name+" = new ndateutil(nda"+name+");");
		stringBuilder.append("nd"+name+".show();");
		stringBuilder.append("});");
		stringBuilder.append("</script>");
		return stringBuilder.toString();
	}
	/**
	 * <p>@Description 查询录入</p>
	 * <p>author rebin </p>
	 * <p>@Time 下午5:21:52</p>
	 * <p>xiefangjian@163.com</p>
	 * @param request
	 * @return
	 */
	protected String ajaxinput(HttpServletRequest request,String name,String sql,String length,String width){//request,sn,sql,length,width
		StringBuilder body = new StringBuilder();
		body.append(potjs(request));//加载Prototype
		body.append(ajaxinputTextJS(request));//加载Prototype
		String basePath = basepath(request);
		String pwidth =LenFormat((width==null)?"120":width);
		Integer swidth = Integer.parseInt(pwidth.substring(0,pwidth.length()-"px".length()));
		body.append("<div style=\"top:0px;left:0px;display: none;position: absolute;z-index:99999;overflow: auto;border: 1px solid #AFAFAF;background-color:#FFFFFF;\"  id=\""+name+"_selectbody\"></div>");
		body.append("<div style=\"float: left;\">");
		body.append("<input type=\"hidden\" name=\""+name+"\" id=\""+name+"\" value=\"\"/>");
		body.append("<div style=\"float: left;display: none;\"  id=\""+name+"_multinput\"></div>");
		body.append("<div id=\""+name+"_sdDiv\" class=\"nk_input_lineheight nk_input_sdDiv\" style=\"width:"+swidth+"px;\">");
		body.append("<input type=\"text\" id=\""+name+"_input\" class=\"nk_input_lineheight nk_input_text\" style=\"width:"+swidth+"px\"/></div>");
		body.append("<div style=\"color: red;float: left;\" class=\"nk_input_lineheight\">*</div>");
		body.append("<img id=\""+name+"_img\" style=\"float: left;\" class=\"nk_input_imgheight\"/><div class=\"nk_input_message\" nowrap id=\""+name+"_div\" style=\"position:absolute;display:none;\"></div>");
		body.append("</div>");
		body.append("<script type=\"text/javascript\">");
		body.append("Event.observe(document, 'dom:loaded', function() {");
		body.append("var cfgs"+getId()+" = {id:'"+name+"',allownull:true,rurl:'"+basePath+"'");
		body.append(",ismore:true");
		if(null!=sql){
			body.append(",sql:'"+sql+"'");
		}
		if(null!=length){
			body.append(",qulenght:"+(length==null?2:length)+"");
		}
		body.append("};");
		body.append("var np"+getId()+" = new ajaxinputtext(cfgs"+getId()+");");
		body.append("np"+getId()+".initinput();");
		body.append("});");
		body.append("</script>");
		return body.toString();
	}
	/**
	 * 生成select
	 * @param request
	 * @param name
	 * @param svn
	 * @return
	 */
	protected String selectCreate(HttpServletRequest request,String name,String[] svn,Integer width,boolean allownull,String lower){
		StringBuilder body = new StringBuilder();
		body.append(potjs(request));//js框架
		body.append(selectCss(request));
		body.append(selectjs(request));//select js
		String basePath = basepath(request);
		StringBuilder json = new StringBuilder();
		String sql = null;
		json.append("[");
		if(svn.length==1 && svn[0].indexOf("^")==-1){//直接sql方式
			sql = svn[0];
		}else if(svn.length>0){
			for(int i=0;i<svn.length;i++){
				json.append("{value:'"+svn[i].split("\\^")[0]+"',text:'"+svn[i].split("\\^")[1]+"'},");
			}
		}
		if(json.length()>3)
			json.delete(json.length()-1, json.length());
		json.append("]");
		body.append("<div id=\""+name+"_sDiv\">");
		body.append("<div id=\""+name+"_selectDiv\" style=\"float:left;\"></div>");
		body.append("<div id=\""+name+"_sboddiv\"  style=\"z-index: 999;background-color: #fff;display:none;position:absolute;overflow-x:hidden;height:100px;top:0px;left:0px;border: 1px solid #ddd;\"></div>");
		body.append("</div>");
		body.append("<script type=\"text/javascript\">");
		//---------------显示树形菜单---------------------------
		body.append("Event.observe(document, 'dom:loaded', function() {");
		body.append("var sfg"+name+" = {");
		body.append("id:'"+name+"',");//id
		body.append("rurl:'"+basePath+"',");//根url
		body.append("slang:'"+Function.lung(request,"org_nokatag_select_pleaseselect")+"',");//语言
		body.append("name:'"+name+"',");//名字
		if(sql!=null)
			body.append("json:'',");//初始始值
		else
			body.append("json:"+(json==null?"''":json.toString().replace("'", "\""))+",");//初始始值
		body.append("height:100,");//宽
		body.append("value:'',");//值
		body.append("readonly:'',");//只读
		body.append("allownull:"+allownull+",");
		body.append("placeholder:'',");
		if(null!=lower)
			body.append("lower:'"+lower+"',");
		body.append("onchange:function(node){return true;},");//onchange
		body.append("width:"+width+",");//宽
		body.append("sql:'"+(null==sql?"":sql)+"'");//sql
		body.append("};");
		body.append("var nr_"+name+"_id = new nselect(sfg"+name+");");
		body.append("nr_"+name+"_id.show();");
		body.append("});");
		body.append("</script>");
		return body.toString();
	}
	/**
	 * 生成多选select
	 * @param request
	 * @param name
	 * @param svn
	 * @return
	 */
	protected String selectMultiCreate(HttpServletRequest request,String name,String[] svn,Integer width,boolean allownull){
		StringBuilder body = new StringBuilder();
		body.append(potjs(request));//js框架
		body.append(selectCss(request));
		body.append(selectMultijs(request));//select js
		String basePath = basepath(request);
		StringBuilder json = new StringBuilder();
		String sql = null;
		json.append("[");
		if(svn.length==1 && svn[0].indexOf("^")==-1){//直接sql方式
			sql = svn[0];
		}else if(svn.length>0){
			for(int i=0;i<svn.length;i++){
				json.append("{value:'"+svn[i].split("\\^")[0]+"',text:'"+svn[i].split("\\^")[1]+"'},");
			}
		}
		if(json.length()>3)
			json.delete(json.length()-1, json.length());
		json.append("]");
		body.append("<div id=\""+name+"_sDiv\">");
		body.append("<div id=\""+name+"_selectDiv\" style=\"float:left;\"></div>");
		body.append("<div id=\""+name+"_sboddiv\"  style=\"z-index: 999;background-color: #fff;display:none;position:absolute;overflow-x:hidden;height:100px;top:0px;left:0px;border: 1px solid #ddd;\"></div>");
		body.append("</div>");
		body.append("<script type=\"text/javascript\">");
		//---------------显示树形菜单---------------------------
		body.append("Event.observe(document, 'dom:loaded', function() {");
		body.append("var sfg"+name+" = {");
		body.append("id:'"+name+"',");//id
		body.append("rurl:'"+basePath+"',");//根url
		body.append("slang:'"+Function.lung(request,"org_nokatag_select_pleaseselect")+"',");//语言
		body.append("name:'"+name+"',");//名字
		if(sql!=null)
			body.append("json:'',");//初始始值
		else
			body.append("json:"+(json==null?"''":json.toString().replace("'", "\""))+",");//初始始值
		body.append("height:100,");//宽
		body.append("value:'',");//值
		body.append("readonly:'',");//只读
		body.append("allownull:"+allownull+",");
		body.append("placeholder:'',");
		body.append("onchange:function(node){return true;},");//onchange
		body.append("width:"+width+",");//宽
		body.append("sql:'"+(null==sql?"":sql)+"'");//sql
		body.append("};");
		body.append("var nr_"+name+"_id = new nselectmulti(sfg"+name+");");
		body.append("nr_"+name+"_id.show();");
		body.append("});");
		body.append("</script>");
		return body.toString();
	}
	/**
	 * 弹出选框
	 * @param request
	 * @param name
	 * @param width
	 * @param bwidth
	 * @param bheight
	 * @param url
	 * @return
	 */
	protected String SelectButton(HttpServletRequest request,String name,String width,String bwidth,String bheight,String url){
		StringBuilder body = new StringBuilder();
		String basePath = basepath(request);
		body.append(potjs(request));//js框架
		body.append(selectCss(request));
		body.append(selectButtonjs(request));//select js
		body.append(nkBoxJsAndCss(request));
		body.append("<div id=\""+name+"_sDiv\">");
		body.append("<div id=\""+name+"_selectDiv\" style=\"float:left;\"></div>");
		body.append("<div id=\""+name+"_BoxDiv\" style=\"display:none;\">");//弹出内容
		body.append(url);
		body.append("</div>");
		body.append("</div>");
		String BHeight=(bheight.endsWith("px")?bheight.substring(0,bheight.length()-2):bheight);
		String BWidth=(bwidth.endsWith("px")?bwidth.substring(0,bwidth.length()-2):bwidth);
		String Width=(width.endsWith("px")?width.substring(0,width.length()-2):width);
		body.append("<script type=\"text/javascript\">");
		//---------------显示树形菜单---------------------------
		body.append("Event.observe(document, 'dom:loaded', function() {");
		body.append("var sfg"+name+" = {");
		body.append("id:'"+name+"',");//id
		body.append("rurl:'"+basePath+"',");//根url
		body.append("name:'"+name+"',");//名字
		body.append("width:"+Width+",");//宽
		body.append("bheight:"+BHeight+",");//弹出框高
		body.append("bwidth:"+BWidth+",");//弹出框宽
		body.append("value:'',");//值
		body.append("svalue:'',");//显示值
		body.append("readonly:'',");//只读
		body.append("allownull:true,");
		body.append("lotype:'iframe',");
		body.append("openfunction:function(){},");//onchange
		body.append("closefunction:function(){},");//onchange
		body.append("placeholder:''");
		body.append("};");
		body.append("var nr"+name+" = new nselectbutton(sfg"+name+");");
		body.append("nr"+name+".show();");
		body.append("});");
		body.append("</script>");
		return body.toString();
	}
	/**
	 * 返回下拉树选择
	 * @param request
	 * @param name
	 * @param rootid
	 * @param sql
	 * @param width
	 * @param type
	 * @return
	 */
	protected String  treeSelect(HttpServletRequest request,String name,String sql_s,String rootid,String width,String cty){
		StringBuilder body = new StringBuilder();// rootid  name sql  width  type
		String basePath = basepath(request);
		//----------参数处理----------------------------------
		String nid = name+"_id";
		String sid=(rootid==null?"":rootid);
		String nwitdh = (width==null?"120px":width);
		width = (nwitdh.endsWith("px")?nwitdh.substring(0,nwitdh.length()-"px".length()):nwitdh);
		body.append(treejs(request));//tree js
		body.append("<div id=\""+nid+"_bdiv\">");
		body.append("<div id=\""+nid+"_sdiv\" class=\"dtree\" style=\"float:left;\"></div>");
		body.append("<div id=\""+nid+"_tdiv\" class=\"dtree\" style=\"width:"+(Integer.parseInt(width)+18)+";z-index: 999;background-color: #fff;display:none;position:absolute;overflow:auto;top:0px;left:0px;border: 1px solid #ddd;\"></div>");
		body.append("</div>");
		body.append("<script type=\"text/javascript\">");
		//---------------显示树形菜单---------------------------
		body.append("Event.observe(document, 'dom:loaded', function() {");
		body.append("var cfg"+nid+" = {");
		body.append("id:'"+nid+"',");//id
		body.append("rurl:'"+basePath+"',");//根url
		body.append("slang:'"+Function.lung(request,"org_nokatag_select_pleaseselect")+"',");//语言
		body.append("url:'',");//url
		body.append("level:2,");//预加载级别
		body.append("spid:'"+sid+"',");//父id
		body.append("sql:'"+sql_s+"',");//sql
		body.append("pramevar:'',");//参数
		body.append("target:'',");//目标
		body.append("formatcell:'',");//格式化列
		body.append("inputname:'"+name+"',");//控件名字
		body.append("checkname:'"+nid+"_check',");//控件名字
		body.append("value:'',");//控件初始值
		body.append("readonly:'',");//只读
		body.append("titlecliek:true,");//标题是否响应点击事件
		body.append("allownull:true,");//允许为空
		body.append("placeholder:'',");
		body.append("width:'"+(nwitdh.endsWith("px")?nwitdh:nwitdh+"px")+"',");//格式化列
		body.append("height:300,");//下拉框最大高度
		body.append("checktype:'"+(null==cty?"":cty)+"',");//级联关系
		body.append("titleonclick:function(node){},");//单击标题
		body.append("nodeonclick:function(node){},");//单击节点
		body.append("checkboxonclick:function(node){return true}");//单击勾选框
		body.append("};");
		body.append("var nr"+nid+" = new ntree(cfg"+nid+");");
		body.append("nr"+nid+".selectShow();");
		body.append("});");
		body.append("</script>");
		return body.toString();
	}
	/**
	 * <p>@Description 横向下拉树</p>
	 * <p>author rebin </p>
	 * <p>@Time 上午10:09:36</p>
	 * <p>xiefangjian@163.com</p>
	 * @param request
	 * @param name
	 * @param sql_s
	 * @param rootid
	 * @param width
	 * @param cty
	 * @return
	 */
	protected String  treeTranSelect(HttpServletRequest request,String name,String sql_s,String rootid,String width,String cty){
		StringBuilder body = new StringBuilder();// rootid  name sql  width  type
		String basePath = basepath(request);
		//----------参数处理----------------------------------
		String nid = name+"_id";
		String sid=(rootid==null?"":rootid);
		String nwitdh = (width==null?"120px":width);
		width = LenNumber(width);//(nwitdh.endsWith("px")?nwitdh.substring(0,nwitdh.length()-"px".length()):nwitdh);
		body.append(treeTranjs(request));//tree js
		body.append("<div id=\""+nid+"_bdiv\">");
		body.append("<div id=\""+nid+"_sdiv\" class=\"trandtree\" style=\"float:left;\"></div>");
		body.append("<div id=\""+nid+"_tdiv\" class=\"trandtree\" style=\"width:"+(Integer.parseInt(width)+18)+";z-index: 999;background-color: #fff;display:none;position:absolute;overflow:auto;top:0px;left:0px;border: 1px solid #ddd;width:100px;\"></div>");
		body.append("</div>");
		body.append("<script type=\"text/javascript\">");
		//---------------显示树形菜单---------------------------
		body.append("Event.observe(document, 'dom:loaded', function() {");
		body.append("var cfg"+nid+" = {");
		body.append("id:'"+nid+"',");//id
		body.append("rurl:'"+basePath+"',");//根url
		body.append("slang:'"+Function.lung(request,"org_nokatag_select_pleaseselect")+"',");//语言
		body.append("sclose:'"+Function.lung(request,"org_nokatag_select_close")+"',");//语言
		body.append("sclear:'"+Function.lung(request,"org_nokatag_select_clear")+"',");//语言
		body.append("url:'',");//url
		body.append("spid:'"+sid+"',");//父id
		body.append("sql:'"+sql_s+"',");//sql
		body.append("pramevar:'',");//参数
		body.append("target:'',");//目标
		body.append("formatcell:'',");//格式化列
		body.append("inputname:'"+name+"',");//控件名字
		body.append("checkname:'"+nid+"_check',");//控件名字
		body.append("value:'',");//控件初始值
		body.append("readonly:'',");//只读
		body.append("titlecliek:true,");//标题是否响应点击事件
		body.append("allownull:true,");//允许为空
		body.append("placeholder:'',");
		body.append("width:"+LenNumber(nwitdh)+",");//格式化列
		body.append("checktype:"+(null==cty?"":cty)+",");//级联关系
		body.append("titleonclick:function(obj,node){},");//单击标题
		body.append("nodeonclick:function(obj,node){},");//单击节点
		body.append("checkboxonclick:function(obj,node){return true}");//单击勾选框
		body.append("};");
		body.append("var nr"+nid+" = new ntreetran(cfg"+nid+");");
		body.append("nr"+nid+".selectShow();");
		body.append("});");
		body.append("</script>");
		return body.toString();
	}
	//=========================获取根路径============================================================
	protected String basepath(HttpServletRequest request){
		return ELFunction.rooturl(request);
	}
	protected  List<TreeGridItem> getTreePars(String treefiled){
		List<TreeGridItem> tList = null;
		if(null!=treefiled){
			String[] sc = treefiled.split("\\[");
			tList = new ArrayList<TreeGridItem>();
			for(String s:sc){
				if(s.indexOf("]")!=-1){
					s = s.substring(0,s.indexOf("]"));
					tList.add(new TreeGridItem(s.split(",")[0], s.split(",")[1]));
				}
			}
		}
		return tList;
	}
	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSql() {
		return sql;
	}

	public void setSql(String sql) {
		this.sql = sql;
	}

	public String getSubtabletype() {
		return subtabletype;
	}

	public void setSubtabletype(String subtabletype) {
		this.subtabletype = subtabletype;
	}

	public String getSubtablestyleid() {
		return subtablestyleid;
	}

	public void setSubtablestyleid(String subtablestyleid) {
		this.subtablestyleid = subtablestyleid;
	}

	public String getSubtable() {
		return subtable;
	}

	public void setSubtable(String subtable) {
		this.subtable = subtable;
	}

	public String getSubformatcell() {
		return subformatcell;
	}

	public void setSubformatcell(String subformatcell) {
		this.subformatcell = subformatcell;
	}

	public String getFormatcell() {
		return formatcell;
	}

	public void setFormatcell(String formatcell) {
		this.formatcell = formatcell;
	}

	public String getOnrowdblclick() {
		return onrowdblclick;
	}

	public void setOnrowdblclick(String onrowdblclick) {
		this.onrowdblclick = onrowdblclick;
	}

	public String getOnrowclick() {
		return onrowclick;
	}

	public void setOnrowclick(String onrowclick) {
		this.onrowclick = onrowclick;
	}

	public String getOutexcelnopage() {
		return outexcelnopage;
	}

	public void setOutexcelnopage(String outexcelnopage) {
		this.outexcelnopage = outexcelnopage;
	}

	public String getOutexcelall() {
		return outexcelall;
	}

	public void setOutexcelall(String outexcelall) {
		this.outexcelall = outexcelall;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getCheckd() {
		return checkd;
	}
	public void setCheckd(String checkd) {
		this.checkd = checkd;
	}
	public String getPagesize() {
		return pagesize;
	}
	public void setPagesize(String pagesize) {
		this.pagesize = pagesize;
	}
	public Integer getStyleid() {
		return styleid;
	}
	public void setStyleid(Integer styleid) {
		this.styleid = styleid;
	}
	public String getSelectfiled() {
		return selectfiled;
	}
	public void setSelectfiled(String selectfiled) {
		this.selectfiled = selectfiled;
	}
	public String getSelectinput() {
		return selectinput;
	}
	public void setSelectinput(String selectinput) {
		this.selectinput = selectinput;
	}
	public String getSelecttitle() {
		return selecttitle;
	}
	public void setSelecttitle(String selecttitle) {
		this.selecttitle = selecttitle;
	}
	public String getCheckrecord() {
		return checkrecord;
	}
	public void setCheckrecord(String checkrecord) {
		this.checkrecord = checkrecord;
	}
	public String getCustombutton() {
		return custombutton;
	}
	public void setCustombutton(String custombutton) {
		this.custombutton = custombutton;
	}
	public String getCheckvalue() {
		return checkvalue;
	}
	public void setCheckvalue(String checkvalue) {
		this.checkvalue = checkvalue;
	}
	public String getCheckname() {
		return checkname;
	}
	public void setCheckname(String checkname) {
		this.checkname = checkname;
	}
	public String getTableformname() {
		return tableformname;
	}
	public void setTableformname(String tableformname) {
		this.tableformname = tableformname;
	}
	public String getTableformid() {
		return tableformid;
	}
	public void setTableformid(String tableformid) {
		this.tableformid = tableformid;
	}
	public String getTableformAction() {
		return tableformAction;
	}
	public void setTableformAction(String tableformAction) {
		this.tableformAction = tableformAction;
	}
	public String getTableformtarget() {
		return tableformtarget;
	}
	public void setTableformtarget(String tableformtarget) {
		this.tableformtarget = tableformtarget;
	}
	public String getTablemethod() {
		return tablemethod;
	}
	public void setTablemethod(String tablemethod) {
		this.tablemethod = tablemethod;
	}
	public String getTextColor() {
		return textColor;
	}
	public void setTextColor(String textColor) {
		this.textColor = textColor;
	}
	public String getBackgroundColor() {
		return backgroundColor;
	}
	public void setBackgroundColor(String backgroundColor) {
		this.backgroundColor = backgroundColor;
	}
	public String getChecks() {
		return checks;
	}
	public void setChecks(String checks) {
		this.checks = checks;
	}
	public String getCells() {
		return cells;
	}
	public void setCells(String cells) {
		this.cells = cells;
	}
	public String getCompositor() {
		return compositor;
	}
	public void setCompositor(String compositor) {
		this.compositor = compositor;
	}
	public String getDescorasc() {
		return descorasc;
	}
	public void setDescorasc(String descorasc) {
		this.descorasc = descorasc;
	}
	public String getAirRowClass() {
		return airRowClass;
	}
	public void setAirRowClass(String airRowClass) {
		this.airRowClass = airRowClass;
	}
	public String getOnsuccess() {
		return onsuccess;
	}
	public void setOnsuccess(String onsuccess) {
		this.onsuccess = onsuccess;
	}
	public String getOnfailure() {
		return onfailure;
	}
	public void setOnfailure(String onfailure) {
		this.onfailure = onfailure;
	}
	public String getOnsubmit() {
		return onsubmit;
	}
	public void setOnsubmit(String onsubmit) {
		this.onsubmit = onsubmit;
	}
	public String getHideselect() {
		return hideselect;
	}
	public void setHideselect(String hideselect) {
		this.hideselect = hideselect;
	}
	public String getReload() {
		return reload;
	}
	public void setReload(String reload) {
		this.reload = reload;
	}
	public Integer getAutoRefresh() {
		return autoRefresh;
	}
	public void setAutoRefresh(Integer autoRefresh) {
		this.autoRefresh = autoRefresh;
	}
	public String getOutcsvnopage() {
		return outcsvnopage;
	}
	public void setOutcsvnopage(String outcsvnopage) {
		this.outcsvnopage = outcsvnopage;
	}
	public String getOutcsvall() {
		return outcsvall;
	}
	public void setOutcsvall(String outcsvall) {
		this.outcsvall = outcsvall;
	}
	public String getCustom() {
		return custom;
	}
	public void setCustom(String custom) {
		this.custom = custom;
	}
	public String getOutpdfnopage() {
		return outpdfnopage;
	}
	public void setOutpdfnopage(String outpdfnopage) {
		this.outpdfnopage = outpdfnopage;
	}
	public String getOutpdfall() {
		return outpdfall;
	}
	public void setOutpdfall(String outpdfall) {
		this.outpdfall = outpdfall;
	}
	public String getOutuserfile() {
		return outuserfile;
	}
	public void setOutuserfile(String outuserfile) {
		this.outuserfile = outuserfile;
	}
	public String getOuttitle() {
		return outtitle;
	}
	public void setOuttitle(String outtitle) {
		this.outtitle = outtitle;
	}
	public String getDataclass() {
		return dataclass;
	}
	public void setDataclass(String dataclass) {
		this.dataclass = dataclass;
	}
	public String getInputData() {
		return inputData;
	}
	public void setInputData(String inputData) {
		this.inputData = inputData;
	}
	public String getFormNull() {
		return formNull;
	}
	public void setFormNull(String formNull) {
		this.formNull = formNull;
	}
	public String getFormConfirmation() {
		return formConfirmation;
	}
	public void setFormConfirmation(String formConfirmation) {
		this.formConfirmation = formConfirmation;
	}
	public String getIsHideHead() {
		return isHideHead;
	}
	public void setIsHideHead(String isHideHead) {
		this.isHideHead = isHideHead;
	}
	public String getIsHideBottom() {
		return isHideBottom;
	}
	public void setIsHideBottom(String isHideBottom) {
		this.isHideBottom = isHideBottom;
	}
	public String getEditCells() {
		return editCells;
	}
	public void setEditCells(String editCells) {
		this.editCells = editCells;
	}
	public String getEditSubmitColor() {
		return editSubmitColor;
	}
	public void setEditSubmitColor(String editSubmitColor) {
		this.editSubmitColor = editSubmitColor;
	}
	public String getEndtSubmitAction() {
		return endtSubmitAction;
	}
	public void setEndtSubmitAction(String endtSubmitAction) {
		this.endtSubmitAction = endtSubmitAction;
	}
	public String getEditOnSubmit() {
		return editOnSubmit;
	}
	public void setEditOnSubmit(String editOnSubmit) {
		this.editOnSubmit = editOnSubmit;
	}
	public String getEditOnReturn() {
		return editOnReturn;
	}
	public void setEditOnReturn(String editOnReturn) {
		this.editOnReturn = editOnReturn;
	}
	public String getEditRow() {
		return editRow;
	}
	public void setEditRow(String editRow) {
		this.editRow = editRow;
	}
	public String getEditAllSubmitAction() {
		return editAllSubmitAction;
	}
	public void setEditAllSubmitAction(String editAllSubmitAction) {
		this.editAllSubmitAction = editAllSubmitAction;
	}
	public String getOnloadjs() {
		return onloadjs;
	}
	public void setOnloadjs(String onloadjs) {
		this.onloadjs = onloadjs;
	}
	public String getOnload() {
		return onload;
	}
	public void setOnload(String onload) {
		this.onload = onload;
	}
	public String getOutfilename() {
		return outfilename;
	}
	public void setOutfilename(String outfilename) {
		this.outfilename = outfilename;
	}
	public String getOutcustom() {
		return outcustom;
	}
	public void setOutcustom(String outcustom) {
		this.outcustom = outcustom;
	}
	public String getCellbody() {
		return cellbody;
	}
	public void setCellbody(String cellbody) {
		this.cellbody = cellbody;
	}
	public String getOnend() {
		return onend;
	}
	public void setOnend(String onend) {
		this.onend = onend;
	}
	public String getOninit() {
		return oninit;
	}
	public void setOninit(String oninit) {
		this.oninit = oninit;
	}
	public String getOnresize() {
		return onresize;
	}
	public void setOnresize(String onresize) {
		this.onresize = onresize;
	}
	public String getAutosize() {
		return autosize;
	}
	public void setAutosize(String autosize) {
		this.autosize = autosize;
	}
	public String getOnSetSumValue() {
		return onSetSumValue;
	}
	public void setOnSetSumValue(String onSetSumValue) {
		this.onSetSumValue = onSetSumValue;
	}
	public String getAutowidth() {
		return autowidth;
	}
	public void setAutowidth(String autowidth) {
		this.autowidth = autowidth;
	}
	public String getSumformatcell() {
		return sumformatcell;
	}
	public void setSumformatcell(String sumformatcell) {
		this.sumformatcell = sumformatcell;
	}
	public String getFoldingLine() {
		return foldingLine;
	}
	public void setFoldingLine(String foldingLine) {
		this.foldingLine = foldingLine;
	}
	public String getFlodingButton() {
		return flodingButton;
	}
	public void setFlodingButton(String flodingButton) {
		this.flodingButton = flodingButton;
	}
	public String getInsertBlankRow() {
		return insertBlankRow;
	}
	public void setInsertBlankRow(String insertBlankRow) {
		this.insertBlankRow = insertBlankRow;
	}
	public String getEditOnSubmitForm() {
		return editOnSubmitForm;
	}
	public void setEditOnSubmitForm(String editOnSubmitForm) {
		this.editOnSubmitForm = editOnSubmitForm;
	}
	public String getEditOnSubmitAll() {
		return editOnSubmitAll;
	}
	public void setEditOnSubmitAll(String editOnSubmitAll) {
		this.editOnSubmitAll = editOnSubmitAll;
	}
	public String getSort() {
		return sort;
	}
	public void setSort(String sort) {
		this.sort = sort;
	}
	public String getConfigid() {
		return configid;
	}
	public void setConfigid(String configid) {
		this.configid = configid;
	}
	public String getMinpage() {
		return minpage;
	}
	public void setMinpage(String minpage) {
		this.minpage = minpage;
	}
	public String getPagecode() {
		return pagecode;
	}
	public void setPagecode(String pagecode) {
		this.pagecode = pagecode;
	}
	public String getTreesql() {
		return treesql;
	}
	public void setTreesql(String treesql) {
		this.treesql = treesql;
	}
	public String getFindtreenode() {
		return findtreenode;
	}
	public void setFindtreenode(String findtreenode) {
		this.findtreenode = findtreenode;
	}
	public String getTreecellwidth() {
		return treecellwidth;
	}
	public void setTreecellwidth(String treecellwidth) {
		this.treecellwidth = treecellwidth;
	}
	public String getSumsql() {
		return sumsql;
	}
	public void setSumsql(String sumsql) {
		this.sumsql = sumsql;
	}
	public String getOntreeclick() {
		return ontreeclick;
	}
	public void setOntreeclick(String ontreeclick) {
		this.ontreeclick = ontreeclick;
	}
	public String getCountsql() {
		return countsql;
	}
	public void setCountsql(String countsql) {
		this.countsql = countsql;
	}
	public String getAirLenRowClass() {
		return airLenRowClass;
	}
	public void setAirLenRowClass(String airLenRowClass) {
		this.airLenRowClass = airLenRowClass;
	}
	public String getOnloadsubtable() {
		return onloadsubtable;
	}
	public void setOnloadsubtable(String onloadsubtable) {
		this.onloadsubtable = onloadsubtable;
	}
	public String getDataurl() {
		return dataurl;
	}
	public void setDataurl(String dataurl) {
		this.dataurl = dataurl;
	}
	public String getSubtableurl() {
		return subtableurl;
	}
	public void setSubtableurl(String subtableurl) {
		this.subtableurl = subtableurl;
	}
	public String getExporturl() {
		return exporturl;
	}
	public void setExporturl(String exporturl) {
		this.exporturl = exporturl;
	}
	public String getFxeidcell() {
		return fxeidcell;
	}
	public void setFxeidcell(String fxeidcell) {
		this.fxeidcell = fxeidcell;
	}
}
